import HTTP from '../utils/http';
import { API } from '../config/config';

const AUTHOR = API.AUTHOR;

export default class AuthorService extends HTTP {
    getAuthorData () {
        return new Promise((resolve, reject) => {
            this.axiosGet({
                url: AUTHOR.GET_AUTHOR_DATA,
                success (data) {
                    resolve(data)
                },
                error (error) {
                    // alert('网络请求失败');
                    console.log(error)
                }
            })
        });
    }

    selectStarAuthor (data) {
        return new Promise((resolve, reject) => {
            this.aixosPost({
                url: AUTHOR.SELECT_STAR_AUTHOR,
                data,
                success (data) {
                    resolve(data)
                },
                error (error) {
                    // alert('网络请求失败');
                    console.log(error)
                }
            })
        });
    }
}